# coding:utf8
import time, socket
from os.path import exists
from os import mkdir

__all__ = ['f_ipv4', 'f_logRepeat', 'f_infoEmail126', 'f_infoEmailQq', 'f_logSent', 'f_logError',
           '_str126', '_strQq', '_strICloud']

# 定义常量 - Constant
if not exists('./_sup'): mkdir('./_sup')                      # make sure the Dir has './_sup'.
f_ipv4 = './_sup/ipv4.ini'                                   # Configuration file - The File save last address of IPv4.
f_logRepeat = './_sup/LogRepeat.txt'
f_logSent = './_sup/LogSent.txt'                             # 保存日志的文件
f_logError = './_sup/ErrorTraceback.log'                     # 保存错误回朔的文件
f_infoEmailQq = './_sup/info_qqEmail.ini'                        # 保存-邮件配置信息
f_infoEmail126 = './_sup/info_126Email.ini'
ipv4 = socket.gethostbyname(socket.gethostname())           # Get IPv4 address.
nowTime = time.strftime("%Y-%m-%d %H:%M", time.localtime())  # Now Time
_str126 = """###注意字符串中禁止包含空格。可以不包含引号。
####删除文件后可以重新生成。
    receiver = 'lee_cq@icloud.com'      # 收件人 (List or Str)
    sender = 'leecq_01@126.com'         # 发件人
    mailHost = "smtp.126.com"           # SMTP 服务器
    mailUser = "leecq_01@126.com"       # User
    mailPasswd = "lichao1234567890"     # Passwd"""

_strQq = """###注意字符串中禁止包含空格。可以不包含引号。
####删除文件后可以重新生成。
    receiver = 'lee_cq@icloud.com'      # 收件人 (List or Str)
    sender = '1491311784@qq.com'         # 发件人
    mailHost = "smtp.qq.com"           # SMTP 服务器
    # mailPort = 465
    mailUser = "1491311784@qq.com"       # User
    mailPasswd = "gfpvtffnkoyigjhb"     # Passwd"""

_strICloud = """###注意字符串中禁止包含空格。可以不包含引号。
####删除文件后可以重新生成。
    receiver = 'lee_cq@icloud.com'      # 收件人 (List or Str)
    sender = 'lee_cq@icloud.com'         # 发件人
    mailHost = "smtp.mail.me.com"           # SMTP 服务器
    # mailPort = 587
    mailUser = "lee_cq@icloud.com"       # User
    mailPasswd = "woal-wfji-egkk-vpvw"     # Passwd"""